package com.example.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Results {
    private Integer code; //编码：1成功，0和其它数字为失败

    private String msg; //错误信息

    private Object data; //数据


    public static Results success(Object data){
        return new Results(1, null, data);
    }

    public static Results error(String msg){
        return new Results(0, msg, null);
    }
}
